home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-07-28 | 2.9 KB | 119 lines | [TEXT/MPS ] |
- /*
- File: StatusDatabase.cp
-
- Copyright: © 1991-1994 by Apple Computer, Inc.
- All rights reserved.
-
- Part of the AOCE Sample SMSAM Package. Consult the license
- which came with this software for your specific legal rights.
-
- */
-
-
-
- #ifndef __STATUSDATABASE__
- #include "StatusDatabase.h"
- #endif
-
- #ifndef __DEBUGASSERT__
- #include "DebugAssert.h"
- #endif
-
- #if 0
-
- /***********************************|****************************************/
-
- LogStatusType gLogStatus;
-
- /***********************************|****************************************/
-
- #pragma segment Initialize
- void InitStatusDatabase(LogStatusType logStatus)
- {
- gLogStatus = logStatus;
-
- gStatusDatabase = new TRamTupleDatabase;
-
- ASSERT_RETURN ( gStatusDatabase != nil );
-
- unsigned long startUpTime;
-
- GetDateTime(&startUpTime);
- SetLongStatus(kGatewayStartupTime,startUpTime);
- SetLongStatus(kGatewayTime,startUpTime);
-
- SetStringStatus(kGatewayName,"Bovine Gateway #1");
- SetLongStatus(kTotalLetters,0);
-
- SetLongStatus(kLettersQueuedToBeReceivedby2020,0);
- SetLongStatus(kLettersSubmittedto2020,0);
- SetLongStatus(kTotalLettersSentFrom2020,0);
- SetLongStatus(kTotalLettersSentFromConnector,0);
- SetLongStatus(kTotalLettersBundled,0);
- SetLongStatus(kBundlesQueuedToBeSent,0);
- SetLongStatus(kBundlesQueuedFromConnector,0);
-
- SetLongStatus(kTotalContentProcessed,0);
- SetLongStatus(kAvailableDiskSpace,0);
- SetLongStatus(kTotalEnclosuresProcessed,0);
- }
-
- /***********************************|****************************************/
-
- Boolean GetLongStatus ( long tupleID, long& theData )
- {
- CWrapperBuffer data ( &theData, sizeof ( theData ) );
- return gStatusDatabase->GetTupleData ( CFourByteKey ( tupleID ), data );
- }
-
- /***********************************|****************************************/
-
- void SetLongStatus ( long tupleID, long theData )
- {
- CWrapperBuffer data ( &theData, sizeof ( theData ) );
- gStatusDatabase->SetTuple ( CFourByteKey ( tupleID ), data );
- }
-
- /***********************************|****************************************/
-
- void DecrementLongStatus ( long tupleID )
- {
- long theData;
-
- if ( GetLongStatus ( tupleID, theData ) )
- SetLongStatus ( tupleID, theData - 1 );
- else
- SetLongStatus ( tupleID, -1 );
- }
-
- /***********************************|****************************************/
-
- void IncrementLongStatus ( long tupleID )
- {
- long theData;
-
- if ( GetLongStatus ( tupleID, theData ) )
- SetLongStatus ( tupleID, theData + 1 );
- else
- SetLongStatus ( tupleID, 1 );
- }
-
- /***********************************|****************************************/
-
- void SetStringStatus ( long tupleID, char* theString )
- {
- gStatusDatabase->SetTuple ( CFourByteKey ( tupleID ), CWrapperBuffer ( theString, strlen ( theString ) ) );
- }
-
- /***********************************|****************************************/
-
- void SetLogString(long tupleID, char* theMsg)
- {
- if (gLogStatus != nil)
- (gLogStatus)(tupleID,theMsg);
- }
-
- /***********************************|****************************************/
-
- #endif
-